package personal.jinhui.paprika.smack.location;

import org.jivesoftware.smack.packet.PacketExtension;

public class LocationExtension implements PacketExtension {

	private String mData;

	public LocationExtension(final String data) {
		mData = data;
	}

	public String getData() {
		return mData;
	}

	@Override
	public String getElementName() {
		return "data";
	}

	@Override
	public String getNamespace() {
		return "urn:xmpp:location:data";
	}

	@Override
	public String toXML() {
		StringBuilder builder = new StringBuilder("<data xmlns=\"");
		builder.append(getNamespace()).append("\">");
		builder.append(mData);
		builder.append("</data>");
		return builder.toString();
	}

}
